from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.types import ModelPlatformType
from camel.messages import BaseMessage
from camel.types import RoleType
from dotenv import load_dotenv
import os
load_dotenv()

Model_Type=os.getenv("MODEL_TYPE")
Model_Api=os.getenv("ZHIPU_API_KEY")
Model_Url=os.getenv("MODEL_URL")
model = ModelFactory.create(
    model_platform=ModelPlatformType.OPENAI,
    model_type=Model_Type,
    api_key=Model_Api,
    url=Model_Url
)
#系统消息··················
system_msg='你是一个经验丰富的医生'
#创建代理
chat_agent = ChatAgent(
    model=model,
    #系统提示词->system_message字段
    system_message=system_msg,
    output_language='中文'
)
#创建用户消息
user_msg='我头疼，请帮我看看'

response = chat_agent.step(user_msg)
print(response.msgs[0].content)
